Skip to content

feat(card): port the thread card, rest stop and the harness fixes since 2026-11-18 - #44

Merged
Exploitacious merged 1 commit into
mainfrom
chore/ops-port-2026-12-02
Dec 2, 2026
Merged

Exploitacious merged 1 commit into
mainfrom
chore/ops-port-2026-12-02

Conversation

@Exploitacious

Copy link
Copy Markdown
Owner

What this does

Carries the thread card and the two-step rest stop into OPS, turns the context-watch ladder into reminders, and brings the smaller harness fixes and doctrine changes made since the last port.

  1. The thread card. A main T3 thread keeps its mission, finish line, open list, how-to and holds in bin/card (state under ${OPS_STATE_DIR:-~/.local/state/ops}/cards/). The Operator is quoted only from what they typed in T3 (web or mobile); harness sends and other agents never count, and anything else is flagged origin unknown. hooks/thread-card.sh prints the card after every compaction. The Stage-1 settings already register the hook (first in resume|compact, 30 s); it stays inert until this ships.
  2. bin/rest-stop prep and arm. Prep reviews the Operator's new messages and writes a five-field draft baton; arm checks the draft and the thread, then publishes the baton and starts compact-cycle.sh. A question in the asks register no longer blocks a rest stop, because the last reply and the open asks travel with the resume. A draft never silences the context-watch interlock.
  3. The context ladder reminds instead of stopping. At 65, 78 and 86% of the window the agent gets a short note right after a tool call that names the rest-stop route; it never blocks and costs no extra turn, and a session that ends its turn there simply stops. Only at 92% is a stop still blocked, because a later compact can lose the summary work it needs room for. When to compact stays the agent's call.
  4. The armed cycle and two T3 reads. compact-cycle.sh stands down when the Operator or another run moved after arming, rechecks the thread once more at the moment of dispatch, and releases its baton when /compact was never accepted; with no arm record it is unchanged. t3-api.sh gains thread-messages and history (paged by cursor, GET only) and compact --arm-record.
  5. A rest stop depends on a live compactor. The compactor's lock records which process holds it, so a lock left behind by a compactor that was killed outright no longer blocks every later rest stop: the next one clears it. An armed baton keeps the context reminders quiet only while its compactor is alive, or for two minutes after arming, so a dead compactor cannot silence them for half an hour. rest-stop first puts a stranded baton back as a draft, unless /compact may already have been sent (a killed worker, or a receipt that never came back), in which case it keeps the baton for recovery and does not send /compact again.
  6. Smaller fixes. git-guard.sh keeps rest-stop and card writes on the main thread, as it does session-end. memory-hint.sh shows each entry once per session. secrets-guard.sh post queues silently instead of costing a feedback turn. report-lint counts a run of approval links as one ask. PROJECTS/sync-check.sh and Sync-Check.ps1 leave linked worktrees alone. asks prefers an exact thread id over ids it starts.
  7. Doctrine and docs. Core, foreman and how-i-work drop rules with no ruling behind them and add three (a person's approval is the control, a plan is parallel work, sort what turns up); the Rhythm section and P2 name the card. bin/README.md, DEPLOYMENT.md, the harness skill and project-kata.md follow.

Off switches

  • CC_THREAD_CARD=0 turns the card print and the rest-stop route off and restores the hand-written baton route; card files stay readable.
  • CC_CONTEXT_WATCH_POSTTOOL=0 silences the mid-turn notes; CC_CONTEXT_WATCH=0 silences the whole context hook.

Known limits

  • T3 offers no dispatch-time precondition, so a message the Operator sends in the instant between the last thread read and the /compact dispatch can still be followed by a compaction. The window is one request long; the message is kept and answered, and the resume then carries a baton written just before it.
  • A thread with more than 40 pages of history since its last card review reports the unreviewed count as unknown and still arms, with a note.
  • The card hook tells a delegated lane from the main thread by agent_id and lane-class; an in-process lane whose compaction payload carries neither would see the main thread's card.

Checks run

  • Syntax over every tracked script, every suite under .claude-config/bin/tests/, every self-test and the two PowerShell suites, as gate.yml runs them: green.
  • The new context-watch cases (a stop below 92% is not blocked, the notes and their spacing, a dead compactor not silencing the hook) fail against the previous hook and pass on this one.
  • Fresh install in a throwaway HOME, deploy twice, then verify-ops.sh: green.
  • gitleaks git --redact over the branch's full history: no findings. OPS's own secrets-scan.sh: clean.
  • The Stage-1 contract test against this tree: the OPS model rules check passes.
  • A private-term scan of the tree, the branch history, this title and this body: no hits beyond the maintainer's own identity in commit headers.

Review

Deploy, gate and guard code (git-guard.sh, secrets-guard.sh, context-watch.sh, pre-compact.sh, compact-cycle.sh, t3-api.sh, rest-stop, card, verify-ops.sh, sync-check.sh) had one review round. The reviewer's own edits are in: the dispatch-time recheck, the kept recovery baton on an uncertain receipt, a secret-shape scan of the reply tail before trimming, and four selftest assertions that had not been running. Its three remaining notes are the known limits above, accepted as documented.

Models: Opus 5.5 · Mythos 5.2 · reviewer: GPT-6.2 Sol, 1 round · harness: Claude Code in T3

Carries the thread card (bin/card, hooks/thread-card.sh), the two-step
rest stop (bin/rest-stop prep and arm), the armed compactor cycle and
its live-lock interlock, the reminder-only context ladder (a stop is
blocked only at 92%), two GET-only T3 reads, the smaller hook fixes and
the doctrine and docs changes made since the last port (2026-11-18).

Review edits: the armed thread is rechecked at dispatch, the recovery
baton is kept when the /compact receipt is uncertain, and the reply
tail is scanned for secret shapes before it is trimmed.
@Exploitacious
Exploitacious merged commit 710bda6 into main Dec 2, 2026
8 checks passed
@Exploitacious
Exploitacious deleted the chore/ops-port-2026-12-02 branch December 2, 2026 23:35
Exploitacious added a commit that referenced this pull request Dec 4, 2026
…46)

* docs(rulings): give each standing order a kind; setup rulings lapse

standing-orders.md gains a fourth column, Kind: setup (with a review date 14 days out), preference or guardrail, and its header explains them. BOOTSTRAP.md writes a non-default Round C posture as setup, Rounds D to F as preference, and box ground rules as guardrail. desk lapse moves a setup ruling past its review date to standing-orders-archive.md unless the Operator says keep; the tool arrives with the clean desk port.

* docs(harness): add the desk facts: kinds, the archive and commands

The harness skill gains a short section on the clean desk review: what cleaning the desk means, the three ruling kinds (setup lapses 14 days after its date unless kept; preference; guardrail, answered alone), that a lapsed or retired ruling is kept in standing-orders-archive.md and nothing is deleted, and the desk commands (desk, review, commit-review, keep, undo). The commands arrive with the template update that carries them.

* fix(secrets): refuse age post-quantum identities in the scanner and card

age 1.4's age-keygen makes AGE-SECRET-KEY-PQ-1 identities by default; the classical shape alone missed them. secrets-scan.sh and card's hard list both take the optional PQ- infix. Cases in card-test.py and secrets-guard-test.sh, built from parts so the files hold no matchable key; both fail on the parent tree.

* test(compact-cycle): pin the dispatch-time arm check and the card route key

OPS #44 carried the arm recheck (compact-arm-check, compact --arm-record) without its unit and t3-api cases; this adds them as the source repo landed them. context-watch-selftest gains the CARD_THREAD-alone key case and the dispatch marker for another baton, and its helpers unset the host's CARD_THREAD so a test run inside a T3 thread cannot change the route.

* feat(memory): add the nightly settle in local mode, opt-in per box

memory-index --settle archives, byte for byte into <pool>/_archive/, the lowest-ranked entries a pool's own digest cannot describe; --restore brings one back and --health records a row per run. The template runs it in local mode only (MEMORY_SETTLE_MODE=local and MEMORY_SETTLE_ROOT in ~/.config/ops/memory-settle.env): it commits in the owner's checkout through a checked write path (settle lock, checkout flock, journal recovery, captured paths, a temporary-index plumbing commit moved by compare-and-swap, executable commit hooks refused) and never fetches, adds a remote or pushes. Any other or missing mode is refused, never guessed. The index writer waits briefly on the settle lock, and the env reader fails closed on any form systemd could read differently.

--find and --hint also read each pool's _archive/, and --find the CONTEXT/projects lessons paragraphs. The 60-entry pool cap warning is gone; verify-ops check 6b now reads the settle's status file and SKIPs on a box without it. memory-backfill-modified stamps missing metadata.modified once before a first settle.

Opt-in by presence: deploy step 11 keeps installed units and the local-mode drop-in current and never installs, creates the env file, enables or starts anything; the named rollout does that per box (bin/README.md, Team box install). memory_settle.py and memory-backfill-modified join OPS_DESTRUCTIVE_TOOLS, their two suites OPS_SANDBOX_SUITES. README also documents t3-api.sh compact --arm-record.

* feat(desk): add the desk check, ruling lapse and keep, and the owner review

bin/desk, one self-contained file shared with the tree the template comes from, checks the AI context a session loads (stale core, dead references, ruling rows, duplicate pools) and caches one line in OPS_STATE_DIR; desk lapse, keep, review, commit-review and undo rewrite and commit the owner's rulings through a checked write path (plumbing commit, commit hooks refused, renameat2 swap, journal recovery).

daily-sync.sh runs run_lapse then run_desk, both non-fatal with one sync.log line each. session-briefing.sh shows the cached Desk line and the one-time lapse notice from OPS_STATE_DIR, reading only. desk joins OPS_DESTRUCTIVE_TOOLS and its three suites OPS_SANDBOX_SUITES. desk-test.py sets OPS_DIR beside COWORK_DIR in its daily-sync harness; session-briefing-desk-test.sh pins this hook's full briefing on resume (it has no resume short form). README desk section and CHANGELOG for the whole pass.

* test(deploy): end the trust step at the new memory settle step

deploy-trust-test.sh evaluates deploy.sh from the trust assignment to the next section; step 11 now follows the trust step, so the cut ends at either section header.

* fix(memory): honor a paused settle on manual runs; defer reload on an unknown T3 state

Review fixes. A manual settle now reads MEMORY_SETTLE through the shared
env-file reader, so the file's pause wins over a stale shell value. Deploy
defers daemon-reload when the T3 status query fails or answers an unknown
value. Tests cover both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant